package com.blank.dao.impl;

import com.blank.dao.ArticleDao;
import com.blank.domain.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class ArticleDaoImpl implements ArticleDao {


    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void addArticle(Article article) {
        //编写sql
        String sql = "insert into t_article values(null,?,?)";
        //执行sql
        jdbcTemplate.update(sql,article.getTitle(),article.getComment());
    }
}
